package nowcoder.written_examination.wangyi;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author fance
 * @date 18-7-2 上午6:17
 */
public class MainIV {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for (int i = 0; i < T; i++) {
            int n = sc.nextInt();
            List<Integer> list = new ArrayList<>();
            int num = n;
            while (num != 0) {
                list.add(0,num);
                int e = list.remove(list.size() - 1);
                list.add(0,e);
                num--;
            }
            if (n>0)
            {
                for (int j = 0; j <n-1 ; j++)
                {
                    System.out.print(list.get(j)+" ");
                }
                System.out.println(list.get(n-1));
            }
        }
    }
}
   /* public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int t = sc.nextInt();
            for (int i = 0; i < t; i++) {
                int n = sc.nextInt();
                int k = sc.nextInt();
                int[] a = new int[2 * n];
                for (int j = 0; j < 2 * n; j++) {
                    a[j] = sc.nextInt();
                }
                int[] res = null;
                    res = a(a,n,k);
                for (int j = 0; j < res.length; j++) {
                    if (j == res.length - 1) {
                        System.out.print(res[j]);
                    } else {
                        System.out.print(res[j] + " ");
                    }
                }
                System.out.println();
            }
        }
    }
    private static int[] a(int[] a,int n,int k) {
        if (k == 0) {
            return a;
        }
        int i = n - 1;
        int j = 2 * n - 1;
        int[] tmp = new int[j + 1];
        int index = 2 * n - 1;
        while (i >= 0) {
            tmp[index--] = a[j--];
            tmp[index--] = a[i--];
        }
        return a(tmp,n,--k);
    }
    private static void b(int n) {
        for (int i = 0; i < n; i++) {

        }
    }
}*/
